package com.qdxwx.models.user;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 后台用户登录日志
 * @author developer
 */
public class UserLogin implements Serializable{


    private static final long serialVersionUID = -2361879304870813251L;
    private Long id;//ID
	private Long userId;//用户ID
    private String userName;//用户名称
    private String userIp;//登录IP
	private String userOs;//操作系统
	private String userAgent;//浏览器

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime loginTime;//登录时间

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserIp() {
        return userIp;
    }

    public void setUserIp(String userIp) {
        this.userIp = userIp;
    }

    public String getUserOs() {
        return userOs;
    }

    public void setUserOs(String userOs) {
        this.userOs = userOs;
    }

    public String getUserAgent() {
        return userAgent;
    }

    public void setUserAgent(String userAgent) {
        this.userAgent = userAgent;
    }

    public LocalDateTime getLoginTime() {
        return loginTime;
    }

    public void setLoginTime(LocalDateTime loginTime) {
        this.loginTime = loginTime;
    }

    @Override
    public String toString() {
        return "UserLogin{" +
                "logId=" + id +
                ", userId=" + userId +
                ", userName='" + userName + '\'' +
                ", userIp='" + userIp + '\'' +
                ", userOs='" + userOs + '\'' +
                ", userAgent='" + userAgent + '\'' +
                ", loginTime=" + loginTime +
                '}';
    }
}
